FROM ubuntu:18.04

ARG toolchainURL=https://developer.arm.com/-/media/Files/downloads/gnu-rm/10.3-2021.10/gcc-arm-none-eabi-10.3-2021.10-x86_64-linux.tar.bz2
ARG toolchainFile=gcc-arm-none-eabi-10.3-2021.10-x86_64-linux.tar.bz2  

# description
LABEL author="lijiacheng@reius.cn" date="2022-04-23"

USER root
WORKDIR /work

# source and software
RUN apt-get update &&\
    apt-get install -y git wget make build-essential libssl-dev libncurses-dev bison flex bc &&\
    wget $toolchainURL && \
    tar -jxvf $toolchainFile 

ENV CROSS_COMPILE=/work/gcc-arm-none-eabi-10.3-2021.10/bin/arm-none-eabi-
